﻿
''' <summary>
''' 主流程控制类
''' </summary>
''' <remarks></remarks>
<Serializable()> Public Class ScreenContorl

    ''' <summary>
    ''' 标题
    ''' </summary>
    ''' <remarks></remarks>
    Private m_Title As String = "Example" '标题
    ''' <summary>
    ''' 离散系数
    ''' </summary>
    ''' <remarks></remarks>
    Private m_DispCoe As String = "U"  '离散系数
    ''' <summary>
    ''' 源的类型选项
    ''' </summary>
    ''' <remarks></remarks>
    Private m_SouceType As String = "P" '源的类型选项
    Private m_ConsistenceRate As Double = 0.5 '浓度占标率标准值
    ''' <summary>
    ''' 浓度占标率标准值
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ConsistenceRate() As Double
        Get
            Return m_ConsistenceRate
        End Get
        Set(ByVal value As Double)
            m_ConsistenceRate = value
        End Set
    End Property
    '------------------------------------------------------
    ''' <summary>
    ''' 点源对象
    ''' </summary>
    ''' <remarks></remarks>
    Private m_PointC As New ScreenView.Point '点源对象
    ''' <summary>
    ''' 面源对象
    ''' </summary>
    ''' <remarks></remarks>
    Private m_AreaC As New Area '面源对象
    ''' <summary>
    ''' 闪光对象
    ''' </summary>
    ''' <remarks></remarks>
    Private m_FlareC As New Flare '闪光对象
    ''' <summary>
    ''' 体源对象
    ''' </summary>
    ''' <remarks></remarks>
    Private m_VolumeC As New Volume '体源对象
    ''' <summary>
    ''' 选项对象
    ''' </summary>
    ''' <remarks></remarks>
    Private m_PubOptionC As New PubOption '选项对象
    '-----------------------------------------------------------
    ''' <summary>
    ''' 存储输入的字符串
    ''' </summary>
    ''' <remarks></remarks>
    Private m_StrInput As String = "" '存储输入的字符串
    ''' <summary>
    ''' 存储输出的字符串
    ''' </summary>
    ''' <remarks></remarks>
    Private m_StrOutput As String = "" '存储输出的字符串


    Private m_ComboxCheck As Integer = 1 '判断
    ''' <summary>
    ''' 判断
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ComboxCheck() As Integer
        Get
            Return m_ComboxCheck
        End Get
        Set(ByVal value As Integer)
            m_ComboxCheck = value
        End Set
    End Property

    ''' <summary>
    ''' 标题
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Title() As String
        Get
            Return m_Title
        End Get
        Set(ByVal value As String)
            m_Title = value
        End Set
    End Property
    ''' <summary>
    ''' 离散系数
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property DispCoe() As String
        Get
            Return m_DispCoe
        End Get
        Set(ByVal value As String)
            m_DispCoe = value
        End Set
    End Property
    ''' <summary>
    ''' 源的类型选项
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property SouceType() As String
        Get
            Return m_SouceType
        End Get
        Set(ByVal value As String)
            m_SouceType = value
        End Set
    End Property

    '---------------------------------------------------
    ''' <summary>
    ''' 点源对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property PointC() As Point
        Get
            Return m_PointC
        End Get
        Set(ByVal value As Point)
            m_PointC = value
        End Set
    End Property

    ''' <summary>
    ''' 面源对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property AreaC() As Area
        Get
            Return m_AreaC
        End Get
        Set(ByVal value As Area)
            m_AreaC = value
        End Set
    End Property

    ''' <summary>
    ''' 闪光对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property FlareC() As Flare
        Get
            Return m_FlareC
        End Get
        Set(ByVal value As Flare)
            m_FlareC = value
        End Set
    End Property

    ''' <summary>
    ''' 体源对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property VolumeC() As Volume
        Get
            Return m_VolumeC
        End Get
        Set(ByVal value As Volume)
            m_VolumeC = value
        End Set
    End Property

    ''' <summary>
    ''' 选项对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property PubOptionC() As PubOption
        Get
            Return m_PubOptionC
        End Get
        Set(ByVal value As PubOption)
            m_PubOptionC = value
        End Set
    End Property

    ''' <summary>
    ''' 存储输入的字符串
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property StrInput() As String
        Get
            Return m_StrInput
        End Get
        Set(ByVal value As String)
            m_StrInput = value
        End Set
    End Property

    ''' <summary>
    ''' 存储输出的字符串
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property StrOutput() As String
        Get
            Return m_StrOutput
        End Get
        Set(ByVal value As String)
            m_StrOutput = value
        End Set
    End Property

    ''' <summary>
    ''' 点源的单位变化  /   Flare源的单位变化
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function StrComboxCheck() As String
        Dim StrComb As String = ""
        If Me.SouceType = "F" Then
            StrComb = Me.FlareC.Flare()
        End If
        If Me.SouceType = "P" Then
            If Me.ComboxCheck = 1 Then
                If Me.PointC.ComboxUnitOption = 1 Then
                    StrComb = Me.PointC.EmissRate / 3.6 & vbCrLf & Me.PointC.StackHigh & vbCrLf & Me.PointC.StaInDiam & vbCrLf & Me.PointC.GasExit & vbCrLf & Me.PointC.GasTemp & vbCrLf & Me.PointC.AirTemp & vbCrLf & Me.PointC.RecepHigh & vbCrLf
                Else
                    StrComb = Me.PointC.EmissRate & vbCrLf & Me.PointC.StackHigh & vbCrLf & Me.PointC.StaInDiam & vbCrLf & Me.PointC.GasExit & vbCrLf & Me.PointC.GasTemp & vbCrLf & Me.PointC.AirTemp & vbCrLf & Me.PointC.RecepHigh & vbCrLf
                End If
            End If
            If Me.ComboxCheck = 2 Then
                If Me.PointC.ComboxUnitOption = 1 Then
                    StrComb = Me.PointC.EmissRate / 3.6 & vbCrLf & Me.PointC.StackHigh & vbCrLf & Me.PointC.StaInDiam & vbCrLf & "VM=" & Me.PointC.GasExit & vbCrLf & Me.PointC.GasTemp & vbCrLf & Me.PointC.AirTemp & vbCrLf & Me.PointC.RecepHigh & vbCrLf
                Else
                    StrComb = Me.PointC.EmissRate & vbCrLf & Me.PointC.StackHigh & vbCrLf & Me.PointC.StaInDiam & vbCrLf & "VM=" & Me.PointC.GasExit & vbCrLf & Me.PointC.GasTemp & vbCrLf & Me.PointC.AirTemp & vbCrLf & Me.PointC.RecepHigh & vbCrLf
                End If
            End If
        End If
        Return StrComb
    End Function

    ''' <summary>
    ''' 地形的选择字符串处理
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function StrTrieetion() As String
        Dim StrTreen As String = ""
        If Me.PubOptionC.YNterrain = "N" Then
            StrTreen = Me.PubOptionC.SimTerrain & vbCrLf
        End If
        If Me.PubOptionC.YNterrain = "Y" Then
            StrTreen = Me.PubOptionC.ComTerrain & vbCrLf
        End If
        If Me.PubOptionC.YNterrain = "Y" Then
            StrTreen = Me.PubOptionC.ComSimTerrain & vbCrLf
        End If
        Return StrTreen
    End Function

    ''' <summary>
    ''' 输入的字符串处理结果1
    ''' </summary>
    ''' <remarks></remarks>
    Public Function StrInput1()
        Dim Str As String = ""
        Dim StrPoint As String = "", StrArea As String = "", StrFlare As String = "", StrVolume As String = ""
        Str = Me.StrTitle() & Me.StrComboxCheck() & Me.DispCoe & vbCrLf & Me.PubOptionC.BuilDown & vbCrLf & Me.PubOptionC.BuildWash() & StrTrieetion() & Me.PubOptionC.StrCompleTerrain() & Me.PubOptionC.SimpleTerrain & vbCrLf & Me.PubOptionC.StrMeteorology() & Me.PubOptionC.StrAutomatedDistances & Me.PubOptionC.StrDiscrDistance & Me.PubOptionC.BuilWashAlgo() & Me.PubOptionC.StFumCalcu() & "N"
        If Me.PubOptionC.ComTerrain = "Y" Then
            Str = Me.StrTitle() & Me.StrComboxCheck() & Me.DispCoe & vbCrLf & "N" & vbCrLf & Me.PubOptionC.YNterrain & vbCrLf & Me.PubOptionC.StrCompleTerrain() & "N" & vbCrLf & "N" & vbCrLf
        End If
        If Me.SouceType = "A" Then
            StrArea = Me.StrTitle() & Me.AreaC.Area() & Me.DispCoe & vbCrLf & Me.StrWindSearch() & Me.PubOptionC.StrMeteorology & Me.PubOptionC.StrAutomatedDistances() & Me.PubOptionC.StrDiscrDistance & "N"
            Str = StrArea
        End If
        If Me.SouceType = "V" Then
            Str = Me.StrTitle() & Me.VolumeC.Volume() & Me.DispCoe & vbCrLf & Me.PubOptionC.SimpleTerrain & vbCrLf & Me.PubOptionC.StrMeteorology & Me.PubOptionC.StrAutomatedDistances & Me.PubOptionC.StrDiscrDistance & "N" & vbCrLf
        End If
        Return Str
    End Function

    ''' <summary>
    ''' 标题及源点    Brode 2 Mixing Height/   Anemometer Height/   Buliding DownWash
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function StrTitle()
        Dim StrTit As String = ""
        StrTit = Me.Title & vbCrLf & Me.SouceType
        If Me.PubOptionC.Mixheigh = "Y" Then
            StrTit += " " & "N"
        End If
        If Me.PubOptionC.AmemhighCheck = "N" Then
            StrTit += " " & Me.PubOptionC.Anemheigh
        End If
        If Me.PubOptionC.ComTerrain <> "Y" Then
            If Me.SouceType = "A" Or Me.SouceType = "V" Then

            Else
                If Me.PubOptionC.BuilDown = "Y" And Me.PubOptionC.Algorithm = "Y" Then
                    StrTit += " " & "SS"
                End If
            End If
        End If
        StrTit += vbCrLf
        Return StrTit
    End Function

    ''' <summary>
    ''' 风向的搜索范围字符串处理
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function StrWindSearch() As String
        Dim StrWinSear As String = ""
        If Me.AreaC.WindSearch = "N" Then
            StrWinSear = Me.AreaC.WindSearch & vbCrLf & Me.AreaC.WindRelat & vbCrLf
        End If
        If Me.AreaC.WindSearch = "Y" Then
            StrWinSear = Me.AreaC.WindSearch & vbCrLf
        End If
        Return StrWinSear
    End Function


    Private m_PrintOutResultAuto() As ScreenView.PrintResultAutoDist
    Private m_PrintOutResultDicrete() As ScreenView.PrintResultDiscrete
    Private m_PrintOutResultMax() As ScreenView.PrintResultMax
    ''' <summary>
    ''' 自动距离
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property PrintOutResultAuto() As ScreenView.PrintResultAutoDist()
        Get
            Return m_PrintOutResultAuto
        End Get
        Set(ByVal value As ScreenView.PrintResultAutoDist())
            m_PrintOutResultAuto = value
        End Set
    End Property
    ''' <summary>
    ''' 离散距离
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property PrintOutResultDicrete() As ScreenView.PrintResultDiscrete()
        Get
            Return m_PrintOutResultDicrete
        End Get
        Set(ByVal value As ScreenView.PrintResultDiscrete())
            m_PrintOutResultDicrete = value
        End Set
    End Property
    ''' <summary>
    ''' 最大值
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property PrintOutResultMax() As ScreenView.PrintResultMax()
        Get
            Return m_PrintOutResultMax
        End Get
        Set(ByVal value As ScreenView.PrintResultMax())
            m_PrintOutResultMax = value
        End Set
    End Property

    ''' <summary>
    ''' 结果分析
    ''' </summary>
    ''' <remarks></remarks>
    Private m_printout As New StrPrintOut
    Property printout() As StrPrintOut
        Get
            Return m_printout
        End Get
        Set(ByVal value As StrPrintOut)
            m_printout = value
        End Set
    End Property

    Private m_ProjectsOption As New ProjectOption
    ''' <summary>
    ''' 项目的选择判断
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ProjectsOption() As ProjectOption
        Get
            Return m_ProjectsOption
        End Get
        Set(ByVal value As ProjectOption)
            m_ProjectsOption = value
        End Set
    End Property
    Private m_ScreenProjectNew As New ScreenView.NewCreatProject
    ''' <summary>
    ''' 做保存处理
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ScreenProjectNew() As ScreenView.NewCreatProject
        Get
            Return m_ScreenProjectNew
        End Get
        Set(ByVal value As ScreenView.NewCreatProject)
            m_ScreenProjectNew = value
        End Set
    End Property
End Class
